<template>
	<view>
		<u-loading-page :loading="loadding" loading-mode="semicircle" loading-text="Hello Pro"></u-loading-page>
		<view v-if="!loadding">
			<view class="team_box" v-if="data !== undefined && data!== null && data.length>0">
				<view class="team_list" v-for="(item,index) in data" :key="index" @click="info(item.id)">
					<view class="team_top">
						<view class="team_top_title">
							<u-icon :label="item.name" size="20" space="8px" color="#1296db"
								name="account-fill"></u-icon>
						</view>
						<view class="team_top_title">
							<u-icon :label="item.phone" size="20" space="8px" color="#1296db"
								name="phone-fill"></u-icon>
						</view>
						<view class="team_top_title">
							<u-icon :label="item.jointime" size="20" labelSize="12" labelColor="#c8c9cc" space="8px"
								color="#1296db" name="clock-fill"></u-icon>
						</view>
					</view>
					<view class="team_bottom">
						<text>设置</text>
						<u-icon name="arrow-right"></u-icon>
					</view>
				</view>
			</view>
			<u-empty class="policy_box" v-else mode="list" icon="/static/Empty/data_null.png">
			</u-empty>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				loadding: true,
				display: false,
				data: []
			}
		},
		onLoad() {
			this._request()
		},
		methods: {
			async _request() {
				const userinfo = uni.getStorageSync('userinfo');
				const {
					data: res
				} = await this.$myHttp5({
					url: 'Team/getMyTeamList',
					header: {
						'token': userinfo.token
					},
				});
				this.loadding = false
				if (res.code == 1) {
					this.data = res.data
					this.display = true
				} else {
					uni.showToast({
						title: res.msg,
						icon: 'none',
						duration: 3000
					})
				}
			},
			info(id) {
				uni.navigateTo({
					url: '/pages/version5/index/team/teamset?id=' + id
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.team_box {
		padding: 20rpx;
		box-sizing: border-box;
		color: #909399;

		.team_top_title {
			margin: 6rpx 0;
		}

		.team_list {
			display: flex;
			align-items: center;
			justify-content: space-between;
			box-sizing: border-box;
			padding: 20rpx;
			box-shadow: 7px 0px 30px -18px #888888;
			margin-bottom: 20rpx;

			.team_top {
				display: flex;
				flex-direction: column;

				text {
					margin-bottom: 20rpx;
				}
			}

			.team_bottom {
				display: flex;

				text {
					font-size: 30rpx;
					margin-right: 6rpx;
					color: #82848a;
				}
			}
		}
	}
</style>